home *** CD-ROM | disk | FTP | other *** search
/ PC Gamer (Italian) 45 / PC Gamer IT CD 45 2-2.iso / FLEET / data1.cab / Doctrines_Files / SubAtkSurf.txt < prev    next >
Text File  |  1999-07-22  |  4KB  |  173 lines

  1. TITLE SubAtkSurf
  2.  
  3. ; Timer 1 : TMA Leg timer
  4. ; Var 1      : Min firing range
  5. ; Var 2   : Store speed before changing it
  6. ; Var 3   : Closing speed calculation
  7. ; Var 4      : 0 = Closing target, 1 = Receding target 
  8. ; Var 5   : Oblique approach angle
  9. ; Var 6      : priority of sub action
  10. ; Var 7   : have we shot at a contact that is active?
  11.  
  12. RULE Store Attack Range for this contact
  13. IF INIT = 1 THEN
  14.     VAR_SET 1 ATTACKRNG
  15.     DEBUG "Max Attack Rng:"
  16.     DEBUG VAR1
  17.     VAR_SET 3 OWNSPD
  18.     VAR_SET 6 200
  19.     VAR_SET 7 0
  20. ELSE
  21.     DEBUG "entering surf attack mode"
  22.     RULE let sub engage
  23.         IF VAR6 > 0 THEN
  24.         RULE Avoid Friendly
  25.         IF ID = FRIEND OR ID = UAF THEN
  26.             DONE
  27.             DEBUG "Avoid friendly"
  28.             TACTIC SubAvoidSurf
  29.         END
  30.  
  31.         ;if we are beyond 20000 yrds then let code take over- just drive to target
  32.         ;OR ( VAR1 > 20000 AND RNG < VAR1 )
  33.         RULE Check Range
  34.         IF RNG < 20000  THEN
  35.             ;if the guy is actively pinging us, then lets waste him!
  36.             RULE attack active intercept
  37.             IF SOURCE = "Active Intercept" AND VAR7 = 0 THEN
  38.                 DEBUG "Attacking Active Ping"
  39.                 ATTACK_BEST
  40.                 VAR_SET 7 1
  41.             ELSE
  42.                 DEBUG "Executing Attack Doctrine"
  43.                 DEBUG "RNG"
  44.                 DEBUG RNG
  45.                 DEBUG "VAR1"
  46.                 DEBUG VAR1
  47.                 RULE ID UPD
  48.                 IF ID = UPD THEN
  49.                     VAR_SET 5 BRG
  50.                     RULE New Leg
  51.                     IF TIMER3 = -1 THEN
  52.                         DEBUG "Silos:"
  53.                         DEBUG SILOS
  54.                         RULE Approaching?
  55.                         IF SILOS > 0 OR RNG > VAR1 THEN
  56.                             DEBUG "UPD Opening Pursuit"
  57.                             VAR_SET 4 1
  58.                             VAR_SET 3 OWNSPD
  59.                             VAR_ADD 3 SILOS
  60.                             VAR_ADD 3 {3,5}
  61.                         ELSE
  62.                             DEBUG "UPD Approaching Leg"
  63.                             VAR_SET 4 0
  64.                             VAR_SET 3 {6,8}
  65.                             VAR_SET 5 BRG
  66.                             RULE Compute oblique angle for leg
  67.                             IF AOB < 0 THEN
  68.                                 VAR_SUB 5 {50,70}
  69.                             ELSE
  70.                                 VAR_ADD 5 {50,70}
  71.                             END
  72.                         END
  73.                         SET_TIMER 3 {300,420}
  74.                     END
  75.                     RULE Proceed on leg, or pursue
  76.                     IF VAR4 = 0 THEN
  77.                         DEBUG "proceed on leg"
  78.                         DEBUG "Setting course:"
  79.                         DEBUG VAR5
  80.                         DEBUG VAR6
  81.                         PRIORITY VAR6
  82.                         SETCRS VAR5
  83.                     ELSE
  84.                         DEBUG "pursuing"
  85.                         DEBUG VAR6
  86.                         PRIORITY VAR6
  87.                         STEER_TO
  88.                     END
  89.  
  90.                     RULE Minimum speed
  91.                     IF VAR3 < 4 THEN
  92.                         DEBUG "min speed"
  93.                         VAR_SET 3 4
  94.                     END
  95.                     PRIORITY VAR6
  96.                     SETSPD VAR3    
  97.                 END
  98.                 RULE ID Hostile        
  99.                 IF ID = HOSTILE OR ID = UAE THEN
  100.                     DEBUG "New Closing Leg"
  101.                     DEBUG "Timer1: "
  102.                     DEBUG TIMER1
  103.                     DEBUG "RNG : "
  104.                     DEBUG RNG
  105.                     DEBUG "VAR1"
  106.                     DEBUG VAR1
  107.                     VAR_SET 5 BRG
  108.                     RULE New Closing Leg
  109.                     ;RNG range to solution is greater than max attack range and no timer is running...
  110.                     IF RNG > VAR1 AND TIMER1 = -1 THEN
  111.                         RULE Approaching?
  112.                         IF SILOS > 0 THEN
  113.                             DEBUG "Hostile Opening Pursuit"
  114.                             VAR_SET 4 1
  115.                             VAR_SET 3 OWNSPD
  116.                             VAR_ADD 3 SILOS
  117.                             VAR_ADD 3 {3,5}
  118.                         ELSE
  119.                             DEBUG "Hostile Approaching Leg"
  120.                             VAR_SET 4 0
  121.                             VAR_SET 3 {6,8}
  122.                             VAR_SET 5 BRG
  123.                             RULE Compute oblique angle for leg
  124.                             IF AOB < 0 THEN
  125.                                 VAR_SUB 5 {50,70}
  126.                             ELSE
  127.                                 VAR_ADD 5 {50,70}
  128.                             END
  129.                         END
  130.                         SET_TIMER 1 {480,600}
  131.                     END
  132.  
  133.                     RULE Proceed on leg, or pursue
  134.                     IF VAR4 = 0 THEN
  135.                         DEBUG "proceed on leg"
  136.                         DEBUG "course :"
  137.                         DEBUG VAR5
  138.                         DEBUG VAR6
  139.                         PRIORITY VAR6
  140.                         SETCRS VAR5
  141.                     ELSE
  142.                         DEBUG "pursuing"
  143.                         PRIORITY VAR6
  144.                         STEER_TO
  145.                     END
  146.     
  147.                     RULE Minimum speed
  148.                     IF VAR3 < 4 THEN
  149.                         DEBUG "min speed"
  150.                         VAR_SET 3 4
  151.                     END
  152.                     PRIORITY VAR6
  153.                     SETSPD VAR3            
  154.  
  155.                     RULE Attack
  156.                     IF RNG < VAR1 AND CONF > 70 THEN
  157.                         DEBUG "attack best"
  158.                         DEBUG VAR6
  159.                         PRIORITY VAR6
  160.                         ATTACK_BEST
  161.                     END
  162.                 END
  163.  
  164.                 RULE PostLaunch
  165.                 IF WEAPON_AWAY = 1 THEN
  166.                     DEBUG "sub avoiding after shot"
  167.                     TACTIC SubAvoidSurf
  168.                 END
  169.             END ;if not active
  170.         END ;if rng
  171.     END ;let sub prosecute
  172. END ;else 
  173.